package org.aspectsense.utilitydsl;

import org.aspectsense.middleware.interfaces.UtilityParsingService;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;

public class Activator implements BundleActivator {


	private ServiceRegistration serviceRegistration;
	private UtilityParsingService ups;
	public void start(BundleContext context) throws Exception {

		ups= new UtilityParsingServiceImpl();
		assert serviceRegistration == null;
	     serviceRegistration = context.registerService(UtilityParsingService.class.getName(), ups, null);
	}

	public void stop(BundleContext context) throws Exception {
		 if(serviceRegistration != null)
	        {
	            serviceRegistration.unregister();
	            serviceRegistration = null;
	        }
	}

}
